package com.zheng.pvz.view
{
	import com.zheng.pvz.action.IAction;
	import com.zheng.pvz.model.proxy.PlantProxy;
	
	import flash.display.DisplayObjectContainer;
	import flash.utils.getTimer;
	
	/**
	 * 陆地上能够攻击的作物，例如：豌豆 
	 * @author Administrator
	 * 
	 */
	public class PlantLandAttack extends PlantClass
	{
		public function PlantLandAttack(contain:DisplayObjectContainer,plantProxy:PlantProxy)
		{
			plantProxy.isLand=true;//只能再陆地使用
			plantProxy.isAttack=true;//能够攻击
			super(contain,plantProxy);
		}
		/**
		 * 
		 * @param timeSpan
		 * 
		 */
		override public function tick(timeSpan:uint):void{
			if(!PlantProxy(this.proxy).isInvade)return;
			var currTimer:int=getTimer();
			var spanTimer:int=currTimer-this.putTimer;
			if(spanTimer<PlantProxy(this.proxy).spanTime)return;
			this.putTimer=currTimer;
			for each(var i:IAction in this.actionArr){
				i.setObj(this);
				i.excute();
			}
		}
	}
}